#ifndef SPRITEANIMATION_H
#define SPRITEANIMATION_H

#include "SDL.h"
#include "Renderable.h"

class SpriteAnimation : public Renderable {
public:
	SpriteAnimation() {}
	SpriteAnimation(int frameHeight, int frameWidth, int loopTime, SDL_Surface* texture, bool loopable = true);
	~SpriteAnimation();
	void setAnimation(int anim);
	//Entity members
	double getXPos() { return xPos; }
	double getYPos() { return yPos; }
	void setXPos(double x);
	void setYPos(double y);
	void setName(std::string name);
	std::string getName() { return name; }
	//Renderable members
	void setTexture(SDL_Surface* texture);
	SDL_Surface* getTexture() { return texture; }
	void setClip(SDL_Rect clip);
	SDL_Rect getClip() { return clip; }
	void update(Uint32 delta);
	void setDirection(Direction dir) {}
	Direction getDirection() { return Renderable::RIGHT; }
	void handleCollision(Direction dir) {}

private:
	int frameHeight, frameWidth;
	int numFrames;
	Uint32 loopTime;
	bool loopable;
	Uint32 elapsedTime;
	int currFrame;
	int currAnimation;

	double xPos;
	double yPos;
	SDL_Surface* texture;
	SDL_Rect clip;
	std::string name;
};

#endif